package cate.game.activity.newherotrial.data;

import easy.java.dev.note.NoteField;

import java.util.HashMap;
import java.util.Map;

public class HeroTrialLevel {
    @NoteField("通过的难度")
    public int passDifficulty;

    @NoteField(value = "领取的记录",detail = "Map<难度,购买记录>")
    public Map<Integer,BuyRecord> buyRecord;

    public void initialize() {
        if (buyRecord == null) {
            buyRecord = new HashMap<>();
        }
    }

    public BuyRecord getOrBuildRecord(int difficulty){
        BuyRecord record = buyRecord.get(difficulty);
        if(record==null){
            record = new BuyRecord();
            buyRecord.put(difficulty, record);
        }
        return record;
    }


    public static class BuyRecord {

        @NoteField("是否领过免费奖励")
        public boolean gotFree;

        @NoteField("是否买过付费礼包")
        public boolean buyGift;

    }
}
